// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import router from './router';
import App from './App';
import store from './store';
import func from './func/socket.js';
import { mapActions } from 'vuex';
Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
    el: '#app',
    store,
    router,
    components: { App },
    template: '<App/>'
});

// socket.on('chat message', function(msg) {
//   store.dispatch('getClientContentList',msg)
// });

socket.on('msg', function(uid, fid, msg) {
    console.log(`${uid}发送给${fid}：${msg}`);
    let data = {
        uid,
        fid,
        massage: msg
    };
    store.dispatch('userMsgList', data);
});
